<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:rich="http://richfaces.ajax4jsf.org/rich"
	xmlns:ctg="http://www.crotouristguide.com/taglib"
	xmlns:a="https://ajax4jsf.dev.java.net/ajax">

<ui:composition template="/templates/layout/columns_1.xhtml">

	<ui:define name="column1" >
		<rich:panel styleClass="blue-panel">
			<h:form >
			<a:region renderRegionOnly="true">
				<ctg:status />
			<s:div styleClass="title"><h1>
				<h:outputText value="#{messages['title.objava.add']}" /></h1>
				#{messages['subtitle.objava']}</s:div>
			<a:outputPanel id="objava">
				<s:decorate id="tipDecoration" template="/templates/edit.xhtml">
					<ui:define name="label">#{messages['label.tip_objave']}</ui:define>
					<h:selectOneMenu value="#{objava.tipObjave}" styleClass="field"
						required="true">
						<s:selectItems var="to" value="#{tipoviObjave}"
							label="#{to.naziv}"></s:selectItems>
						<s:convertEntity></s:convertEntity>
					</h:selectOneMenu>
				</s:decorate>
				<s:decorate id="naslovDecoration" template="/templates/edit.xhtml">
					<ui:define name="label">#{messages['label.naslov']}</ui:define>
					<h:inputText value="#{objava.naslov}"
						styleClass="field f450" required="true">

					</h:inputText>
				</s:decorate>
				<s:decorate id="siteDecoration" template="/templates/edit.xhtml">
					<ui:define name="label">#{messages['label.site.title']}</ui:define>
					<h:inputText value="#{objava.stranica}"
						styleClass="field f450" required="true">

					</h:inputText>
				</s:decorate>
				<s:decorate id="wwwDecoration" template="/templates/edit.xhtml">
					<ui:define name="label">#{messages['label.www']}</ui:define>
					<h:inputText value="#{objava.www}"
						styleClass="field f450" required="true">

					</h:inputText>
				</s:decorate>
				<s:decorate id="textDecoration" template="/templates/edit.xhtml">
					<ui:define name="label">#{messages['label.tekst']}</ui:define>
					<h:inputTextarea value="#{objava.tekst}" styleClass="text t450"
						required="true">

					</h:inputTextarea>
				</s:decorate>
				<br />
				<h:panelGroup>

					<a:commandButton value="#{messages['label.submit']}" rendered="#{objava.idObjave == null}"
						action="#{objavaAction.add}" reRender="objava">
						<f:param name="idObjekta" value="#{param.idObjekta}"/>
						<f:param name="idMjesta" value="#{param.idMjesta}"/>
						<f:param name="idOtoka" value="#{param.idOtoka}"/>
					</a:commandButton>
						<a:commandButton value="#{messages['label.submit']}"
							action="#{objavaAction.edit}" rendered="#{objava.idObjave != null}">
						</a:commandButton>
						<a:commandButton value="#{messages['label.delete']}" immediate="true"
							action="#{objavaAction.delete}" rendered="#{objava.idObjave != null}">
						</a:commandButton>		

					<h:commandButton action="#{objavaAction.back}"
						value="#{messages['label.cancel']}" immediate="true">
					</h:commandButton>
				</h:panelGroup>
				</a:outputPanel>
				</a:region>
			</h:form>
		</rich:panel>
	</ui:define>
	<ui:define name="column2">

	</ui:define>
</ui:composition>

</html>